﻿@namespace FluentCMS.Web.Plugins

<PluginBody Title="@Title">
    <CardBody>
        @if (Model != null)
        {
            <EditForm Model="@Model" OnSubmit="HandleSubmit" FormName="@Name" Enhance>
                <DataAnnotationsValidator />
                <Spacer />
                @if(!string.IsNullOrEmpty(Description))
                {
                    <Typography>
                        @Description
                    </Typography>
                    <Spacer />
                }
                <Grid GutterX="GridGutter.Large">
                    @ChildContent
                </Grid>
                <Spacer />
                <Alert Visible="Errors.Count > 0" Type="AlertType.Danger">
                    @foreach (var error in Errors)
                    {
                        <p>@error</p>
                    }
                </Alert>
            </EditForm>
        }
    </CardBody>
</PluginBody>
